Playwright Migration: topicPage#14187
Draft
MeriemMechri wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates topicPage end-to-end coverage to Playwright in the ws-nextjs-app, including page-content checks, pagination behaviours, and ATI analytics assertions (notably for Message Banner tracking).
Changes:
- Added a new Playwright
topicPagespec covering core content assertions, pagination navigation, script switching, and shared canonical behaviours. - Introduced
topicPagesuite definitions to parameterise runs across services/environments (canonical, ATI, ATI Lite). - Extended ATI analytics Playwright helpers/assertions to support the Message Banner component (view + click).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ws-nextjs-app/playwright/specialFeatures/atiAnalytics/helpers.ts | Adds MESSAGE_BANNER to the ATI component registry for request matching. |
| ws-nextjs-app/playwright/specialFeatures/atiAnalytics/assertions.ts | Adds Playwright ATI assertions for Message Banner view and click events. |
| ws-nextjs-app/playwright/pageTypes/topicPage/topicPage.spec.ts | New Playwright topicPage test suite (content, pagination, script switching, ATI analytics). |
| ws-nextjs-app/playwright/pageTypes/topicPage/suites.ts | New suite definitions for canonical + ATI + ATI Lite topicPage runs. |
Comment on lines
+354
to
+367
| const messageBannerTitle = topicPageState.messageBanner?.title; | ||
| const messageBannerTestId = messageBannerTitle | ||
| ? `message-banner-${idSanitiser(messageBannerTitle)}` | ||
| : undefined; | ||
| const messageBannerLinkLocator = messageBannerTestId | ||
| ? page | ||
| .locator(`[data-testid="${messageBannerTestId}"]`) | ||
| .locator('a') | ||
| .first() | ||
| : page | ||
| .locator('[data-testid^="message-banner-"]') | ||
| .first() | ||
| .locator('a') | ||
| .first(); |
Comment on lines
+188
to
+192
| const shouldTestTwoTierNav = (suite: TopicPageTestSuite) => { | ||
| const serviceName = | ||
| getServiceConfig(suite.service, suite.variant)?.name || suite.service; | ||
| return twoTierNavServices[appEnvFromProcess]?.includes(serviceName) ?? false; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: WS-2729
Summary
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
Testing
Useful Links